﻿/**************************************************************
 * Copyright gt1987. All rights reserved.
 * 
 * Author: guitao(guitao@eastmoney.com) 
 * Create Date: 2020/4/14 15:28:02
 * Description: ShortMessageService
 *          
 * Revision History:
 *      Date         Author               Description
 *              
***************************************************************/

using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;

namespace gt.ShortMessage.Services.Impls
{
    public class ShortMessageService : IShortMessageService
    {
        private readonly IMessageProivder _messageProivder;
        private ILogger _logger;

        public ShortMessageService(IMessageProivder messageService,
            ILogger<ShortMessageService> logger)
        {
            _messageProivder = messageService;
            _logger = logger;
        }

        public bool SendActiveCode(string code, string businessId)
        {
            var message= _messageProivder.BuildShortMessage(businessId, code);
            //假装发送了短信~~~
            _logger.LogDebug($"send message success,context:{message}");
            return true;
        }
    }
}
